package translation;

import libraries.LibraryContainer;
import libraries.TransConn;
import libraries.TransPart;



public class Part {

	String name;
	String path;
	String value;
	TransConn connectors;
	String comment;
	
	
	public Part(String name, String path, String value, String comment) {
		super();
		this.name = name;
		this.path = path;
		this.value = value;
	}
	
	
	public Part(String name, String value, String device, String pack, String library, String sheet, LibraryContainer tPLib) {
		super();
		this.name = name;
		TransPart trans =tPLib.find(device, pack, library);
		this.path = trans.getMoPath();
		this.comment = trans.getComment();
		if (trans.getValuetype() == 0) {
			this.value = "";
		} else if (trans.getValuetype() == 1) {
			this.value = trans.getValue() + value;
		} else {
			this.value = trans.getValue();
		}
		this.connectors = trans.getConn();
	}


	public String getComment() {
		return comment;
	}


	public String getName() {
		return name;
	}


	public String getPath() {
		return path;
	}


	public String getValue() {
		return value;
	}


	public TransConn getConnectors() {
		return connectors;
	}
	
	
}
